package ink.lovejinhu.leetcode;

public class Solution_0189 {
    /**
     * 旋转数组
     *
     * @param nums
     * @param k
     */
    public void rotate(int[] nums, int k) {
        int[] ints = new int[nums.length];
        for (int i = 0; i < nums.length; i++) {
            ints[(i + k )% nums.length] = nums[i];
        }
        for (int i = 0; i < nums.length; i++) {
            nums[i] = ints[i];
        }
    }
}
